import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.TreeSet;

public class Main3{

    private static Scanner in;

    public static void main(String[] args) {
        in = new Scanner(System.in);
        ArrayList<String> List = new ArrayList<>();
        String st;
        st = in.next();
        while (st.compareTo("!!!!!") != 0) {
            List.add(st);
            st = in.next();
        }
        TreeSet<String> set = new TreeSet<String>(List);
        List.clear();
        List.addAll(set);
        System.out.println(List.size());
        if (List.size() > 10) {
            for (int i = 0; i < 10; i++) {
                System.out.println(List.get(i));
            }
        } else {
            for (int i = 0; i < List.size(); i++) {
                System.out.println(List.get(i));
            }
        }
    }
}
